<?php
/**
 * 核心文件
 *
 * 核心初始化类，不允许继承
 *
 * @package    core
 * @copyright  Copyright (c) 2007-2013 ShopNC Inc. (http://www.shopnc.net)
 * @license    http://www.shopnc.net
 * @link       http://www.shopnc.net
 * @author	   ShopNC Team
 * @since      File available since Release v1.1
 */
defined('InWordPs') or exit('Access Invalid!');
final class Base{


	public static function autoload($class){
        echo $class.'<br>';
        if(!class_exists($class)){
		    $class = strtolower($class);
            if (ucwords(substr($class,-5)) == 'Class' ){
                if (!@include_once(BASE_DATA_PATH.'/'.substr($class,0,-5).'.class.php')){
                    exit("Class Error: {$class}.isn't exists!");
                }
            }elseif (ucwords(substr($class,0,5)) == 'Cache' && $class != 'cache'){
                if (!@include_once(BASE_DATA_PATH.'/cache/'.substr($class,0,5).'.'.substr($class,5).'.php')){
                    exit("Class Error: {$class}.isn't exists!");
                }
            }elseif ($class == 'db'){
                if (!@include_once(BASE_DATA_PATH.'/db/'.strtolower(DBDRIVER).'.php')){
                    exit("Class Error: {$class}.isn't exists!");
                }
            }else{
                if (!@include_once(BASE_DATA_PATH.'/'.$class.'.php')){
                    exit("Class Error: {$class}.isn't exists!");
                }
            }
        }
	}


}